if(window.location.href.split('&')[1]){
    $('.account-tab a').removeClass('tab-active');
    $('.tab-wallet').addClass('tab-active');
    $('.tab-wallet').css('display','block');
    $('.main-card').css('display','none');
     $('.wallet-not').css('display','block');
}else{}
//银行卡虚拟钱包tab切换
$('.account-tab a').click(function(){
    $('.account-tab a').removeClass('tab-active');
    $(this).addClass('tab-active');
})
$('.tab-bankcard').click(function(){
    $('.main-card').css('display','block');
    $('.wallet-not').css('display','none');
    $('.card-not').css('display','block');
    $('.ver-not').css('display','none');
})
$('.tab-wallet').click(function(){
    $('.main-card').css('display','none');
    $('.wallet-not').css('display','block');
    $('.card-not').css('display','none');
    $('.ver-not').css('display','block');
})
   //银行卡提现
   $('.withdraw-btn').click(function(){
   var amount = Number($('.amount').val());
   var capital = Number($('.capital').html());
   console.log(amount)
   console.log(capital)
        if(amount>capital){
               $('.info-err').html('您的余额为'+capital+"元，余额不足,<a href='/capital-recharge?viewType=page'>请充值</a>");
        }else if(!amount){
            $('.info-err').html('提现金额不能为空');
            return;
        }else{
             var data = {
                    amount:amount,
                    walletType:1
                  }
             $.ajax({
                  url:"/capital-withdraw.json",
                  type:"post",
                     data:JSON.stringify(data),
                     contentType:'application/json;charset=UTF-8',
                  success:function(data){
                       console.log(data)
                       $('.info-err').html('申请已发送，请等待审核');
                   },
                   error: function(msg) {
                       console.log(msg.responseText)
                       $('.info-err').html(JSON.parse(JSON.parse(msg.responseText).errors[0].msg));
                   }
               })
        }
   })
   //虚拟钱包提现
 $('.withdraw-wallet-btn').click(function(){
   var amount = $('.wallet-not-account').val();
   var capital = $('.virtualCapital').html();
        if(amount>capital){
               $('.info-err2').html('您的余额为'+capital+"余额不足,<a href='/capital-recharge?viewType=page'>请充值</a>");
        }else if(!amount){
            $('.info-err2').html('提现金额不能为空');
        }else{
             var data = {
                    amount:amount,
                    walletType:2
                  }
             $.ajax({
                  url:"/capital-withdraw.json",
                  type:"post",
                     data:JSON.stringify(data),
                     contentType:'application/json;charset=UTF-8',
                  success:function(data){
                       console.log(data)
                       $('.info-err2').html('申请已发送，请等待审核');
                   },
                   error: function(msg) {
                       console.log(msg)
                   }
               })
        }
   })